home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / blockmap.man < prev    next >
Encoding:
Text File  |  1993-09-05  |  5.4 KB  |  166 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      BlockMap - display of block-based graphics
  7.  
  8. SYNOPSIS
  9.      #include <BlockMap.h>
  10.  
  11.      class BlockMap
  12.  
  13.      class BlockImages
  14.        class ColourBlockImages
  15.        class WideColourBlockImages
  16.        class MonochromeBlockImages
  17.        class WideMonochromeBlockImages
  18.  
  19.      class BlockMapView
  20.  
  21. DESCRIPTION
  22.      A very large number of existing programs construct the screen display
  23.      from a grid of square images (blocks).  This modules provides for the
  24.      map which makes up the whole area of blocks (BlockMap), for various
  25.      kinds of images used for the blocks (BlockImages), and for the
  26.      rectangular view of a BlockMap (BlockMapView).
  27.  
  28. CLASSES
  29.      class BlockMap
  30.        A rectangular matrix of characters or short integers.
  31.  
  32.      class BlockImages
  33.        Lists of rectangular images.
  34.  
  35.        class ColourBlockImages - 16xH in 16 colours
  36.        class WideColourBlockImages - 32xH in 16 colours
  37.        class MonochromeBlockImages - 16xH in 1 colour
  38.        class WideMonochromeBlockImages - 32xH in 1 colour
  39.  
  40.      class BlockMapView
  41.        A view of a BlockMap, where the char/short are interpretted as
  42.        indices into a BlockImages.
  43.  
  44. CLASS MEMBERS
  45.   BlockMap::
  46.      BlockMap(short w, short h, int MaxBlockImages=256)
  47.        Create a BlockMap with the given dimensions, and capable of
  48.        storing the given number of values at each position.
  49.        The BlockMap class intelligently uses char or short representations
  50.        for the elements of the map to save on memory.
  51.  
  52.      short operator() (short x, short y)
  53.      short operator() (Point& P) { return operator()(P.x,P.y) }
  54.        Return the value at (x,y) in the map.
  55.  
  56.      void Set(short x, short y, short ch)
  57.      void Set(Point& P, short ch) { Set(P.x,P.y,ch) }
  58.        Set the value at (x,y) in the map.
  59.  
  60.      bool Includes(short x, short y)
  61.      bool Includes(Point& P) { return Includes(P.x,P.y) }
  62.        TRUE if the given (x,y) is in the map.
  63.  
  64.      int fput(FILE *fp)
  65.      int fget(FILE *fp)
  66.        Input/Output  [NOT IMPLEMENTED]
  67.  
  68.      BlockMap(short w, short h, char *map)
  69.      BlockMap(short w, short h, short *map)
  70.        Create a BlockMap from an existing 2-dimensional array.
  71.        eg.
  72.               short Map[64][64];
  73.               BlockMap Bmap(64,64,Map[0]);
  74.  
  75.        These constructors are of limited value, since the existing
  76.        array should not be directly accessed anyway, since this
  77.        defeats the incremental update facilities of BlockMapViews.
  78.  
  79.   BlockImages::
  80.    ColourBlockImages::
  81.    WideColourBlockImages::
  82.    MonochromeBlockImages::
  83.    WideMonochromeBlockImages::
  84.  
  85.      ColourBlockImages(short MaxBlocks, short Height)
  86.      WideColourBlockImages(short MaxBlocks, short Height)
  87.      MonochromeBlockImages(short MaxBlocks, short Height)
  88.      WideMonochromeBlockImages(short MaxBlocks, short Height)
  89.        Create a BlockImages capable of defining the given number of
  90.        blocks, each of the given height.
  91.         (Note that no public constructors exist for plain
  92.          BlockImages, as it is an abstract class)
  93.  
  94.      void GetImages(short c, int num, Screen&)
  95.        Get num images, starting with image c, from the given screen.
  96.        Images are taken from consecutive positions on the screen -
  97.        eg. for 16x14 colour images taken from a STLow screen, 20
  98.            are taken from the first strip of 14 lines, then the 
  99.            next 20 are taken from the next strip, etc. (20 images
  100.            that are 16 pixels wide fit across a 320 pixel screen).
  101.  
  102.      virtual void GetImage(short c, int x, int y, Screen&)
  103.      virtual void GetImage(short c, Point& P, Screen&)
  104.        Lower level version of the above routine.  Get image c in the
  105.        list from the given (x,y) position on the given Screen.
  106.  
  107.   BlockMapViews::
  108.      BlockMapView(BlockMap& m, BlockImages& Im,
  109.       short sx, short sy, short w, short h,
  110.       short x=0, short y=0)
  111.  
  112.        Position the view at pixel (sx,sy) on screen (determined by Pages,
  113.        see DoubleBuffer for details), w by h blocks in size, viewing (x,y)
  114.        in the given map by using the given BlobkImages for display.
  115.  
  116.      void Views(short x, short y)
  117.      void Views(Point& P)
  118.        View the area at (x,y) in the map.
  119.  
  120.      void Resize(short w, short h)
  121.        Change the size of the view (in blocks).
  122.  
  123.      void ViewsArea(Rectangle R)
  124.        Change both the position and area of the view.
  125.        (combines two previous operations)
  126.  
  127.      void MoveView(short sx, short sy)
  128.      void MoveView(Point P)
  129.        Change the screen-view position of the map.
  130.  
  131.      void ViewsMap(BlockMap& m)
  132.        Change the map being viewed.
  133.  
  134.      void ViewsImages(BlockImages& Im)
  135.        Change the images used to display the map.
  136.  
  137.      void Draw()
  138.        Incrementally draw the map (ie. only draw the changed parts).
  139.  
  140. USAGE
  141.      1. Create a BlockMap.
  142.      2. Create a BlockImages.
  143.      3. Create a BlockMapView from these two.
  144.      4. Call the Draw() method in the main animation loop. (see DoubleBuffer)
  145.  
  146. FILES
  147.      I/O is not currently implemented.
  148.  
  149. SEE ALSO
  150.      Screen
  151.  
  152. AUTHOR
  153.      Warwick Allison, 1992.
  154.      warwick@cs.uq.oz.au
  155.  
  156. COPYING
  157.      This functionality is part of the Atari Machine Specific Library,
  158.      and is Copyright 1992 by Warwick W. Allison.
  159.  
  160.      The Atari Machine Specific Library is free and protected under the
  161.      GNU Library General Public License.
  162.  
  163.      You are free to copy and modify these sources, provided you acknowledge
  164.      the origin by retaining this notice, and adhere to the conditions
  165.      described in the GNU LGPL.
  166.